import java.io.*;

public class demo5 {
    public static void main(String[] args) throws IOException {
        File file = new File("../test.txt");
        try(OutputStream outputStream = new FileOutputStream(file)){
            PrintWriter printWriter = new PrintWriter(outputStream);
            printWriter.println("hello");
            //记得刷新内存缓冲区
            printWriter.flush();
        }
    }
}
